package cn.com.blueInfo.bpm.person.enums;

import cn.com.blueInfo.bpm.common.enums.BaseEnum;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 学历
 * @author suxch
 * @since 2025-08-28 22:06:38
 */
@Getter
@AllArgsConstructor
public enum UserBaseEducation implements BaseEnum<Integer> {

    /** 学历-小学 */
    PRIMARY_SCHOOL(0, "小学"),
    /** 学历-初中 */
    JUNIOR_HIGH_SCHOOL(1, "初中"),
    /** 学历-高中 */
    SENIOR_HIGH_SCHOOL(2, "高中"),
    /** 学历-中专 */
    TECHNICAL_SECONDARY_SCHOOL(3, "中专"),
    /** 学历-大专 */
    COLLEGE(4, "大专"),
    /** 学历-本科 */
    BACHELOR(5, "本科"),
    /** 学历-硕士 */
    MASTER(6, "硕士"),
    /** 学历-博士 */
    DOCTOR(7, "博士");

    @EnumValue
    private final Integer code;

    @JsonValue
    private final String desc;

    public static UserBaseEducation getByCode(Integer code) {
        return BaseEnum.getByCode(UserBaseEducation.class, code);
    }

    @JsonCreator
    public static UserBaseEducation getByName(String name) {
        return BaseEnum.getByName(name, UserBaseEducation.class);
    }

}
